import { Link } from "umi";
import { Breadcrumb } from 'antd'


const Breadcrumbs = () => {
    const routes = [
        {
            path: '/',
            breadcrumbName: '工作台'
        },
        {
            path: 'user/user',
            breadcrumbName: '用户管理',
        },
        {
            path: 'view/view',
            breadcrumbName: '访问统计',
        },
    ];

    function itemRender(route: any, params: any, routes: any, paths: any) {
        const last = routes.indexOf(route) === routes.length - 1;
        return last ? (
            <span>{route.breadcrumbName}</span>
        ) : (
            <Link to={paths.join('/')}>{route.breadcrumbName}</Link>
        );
    }

    return <Breadcrumb itemRender={itemRender} routes={routes} />
}
export default Breadcrumbs



